home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form SetterDialog
- Caption = "Property Setter"
- ClientHeight = 3975
- ClientLeft = 2145
- ClientTop = 1740
- ClientWidth = 3990
- Height = 4665
- Left = 2085
- LinkTopic = "Form1"
- ScaleHeight = 3975
- ScaleWidth = 3990
- Top = 1110
- Width = 4110
- Begin VB.CommandButton CmdSetValues
- Caption = "Set Values"
- Height = 495
- Left = 1440
- TabIndex = 3
- TabStop = 0 'False
- Top = 3360
- Width = 1095
- End
- Begin VB.CommandButton CmdClose
- Cancel = -1 'True
- Caption = "Close"
- Height = 495
- Left = 2760
- TabIndex = 4
- TabStop = 0 'False
- Top = 3360
- Width = 1095
- End
- Begin VB.CommandButton CmdGetValues
- Caption = "Get Values"
- Default = -1 'True
- Height = 495
- Left = 120
- TabIndex = 2
- TabStop = 0 'False
- Top = 3360
- Width = 1095
- End
- Begin VB.TextBox ValuesText
- BeginProperty Font
- name = "Courier New"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- Height = 2175
- Left = 120
- Locked = -1 'True
- MultiLine = -1 'True
- ScrollBars = 3 'Both
- TabIndex = 8
- TabStop = 0 'False
- Top = 1080
- Width = 3735
- End
- Begin VB.TextBox ValueText
- Height = 285
- Left = 960
- TabIndex = 1
- Top = 480
- Width = 2895
- End
- Begin VB.TextBox PropertyText
- Height = 285
- Left = 960
- TabIndex = 0
- Top = 120
- Width = 2895
- End
- Begin VB.Label Label1
- Caption = "Current Values:"
- Height = 255
- Index = 2
- Left = 120
- TabIndex = 7
- Top = 840
- Width = 1215
- End
- Begin VB.Label Label1
- Caption = "New Value:"
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 6
- Top = 480
- Width = 855
- End
- Begin VB.Label Label1
- Caption = "Property:"
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 5
- Top = 120
- Width = 855
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileClose
- Caption = "&Close"
- Shortcut = ^C
- End
- End
- Begin VB.Menu mnuProp
- Caption = "&Properties"
- Begin VB.Menu mnuPropSet
- Caption = "&Set Values"
- Shortcut = ^S
- End
- Begin VB.Menu mnuPropGet
- Caption = "&Get Values"
- Shortcut = ^G
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "&Help"
- Begin VB.Menu mnuHelpAbout
- Caption = "&About Property Setter"
- End
- End
- Attribute VB_Name = "SetterDialog"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- ' ************************************************
- ' The user uses this dialog to specify properties
- ' and the values they should have. When the user
- ' presses the Apply button, the form invokes the
- ' PropSet object's Apply subroutine to set the
- ' property values.
- ' ************************************************
- Option Explicit
- ' The PropSet object.
- Public prop_setter As PropSet
- ' ************************************************
- ' Get the indicated property values for the
- ' selected controls.
- ' ************************************************
- Private Sub CmdGetValues_Click()
- Dim prop_name As String
- Dim values As String
- ' Get the property name.
- prop_name = Trim$(PropertyText.Text)
- If prop_name = "" Then
- Beep
- MsgBox "Please enter a property name.", _
- vbOKOnly + vbInformation, _
- "Blank Property Name"
- Exit Sub
- End If
- ' List the property values.
- values = prop_setter.GetValues(prop_name)
- ValuesText.Text = values
- End Sub
- ' ************************************************
- ' Invoke the PropSet object's Apply subroutine.
- ' ************************************************
- Private Sub CmdSetValues_Click()
- Dim prop_name As String
- Dim prop_value As String
- Dim values As String
- ' Get the property name.
- prop_name = Trim$(PropertyText.Text)
- If prop_name = "" Then
- Beep
- MsgBox "Please enter a property name.", _
- vbOKOnly + vbInformation, _
- "Blank Property Name"
- Exit Sub
- End If
- ' Get the property value. Note that a blank
- ' value is valid.
- prop_value = Trim$(ValueText.Text)
- ' Set the property values and get the
- ' updated list.
- values = prop_setter.SetValues(prop_name, prop_value)
- ValuesText.Text = values
- End Sub
- ' ************************************************
- ' Unload the dialog.
- ' ************************************************
- Private Sub CmdClose_Click()
- Unload Me
- End Sub
- ' ************************************************
- ' Start with a list of names.
- ' ************************************************
- Private Sub Form_Load()
- Dim values As String
- values = prop_setter.GetValues("")
- ValuesText.Text = values
- End Sub
- ' ************************************************
- ' Make the value text area as large as possible.
- ' ************************************************
- Private Sub Form_Resize()
- Dim gap As Single
- Dim wid As Single
- Dim hgt As Single
- gap = ValuesText.Left
- wid = ScaleWidth - gap - PropertyText.Left
- If wid < 480 Then wid = 480
- PropertyText.Width = wid
- ValueText.Width = wid
- wid = ScaleWidth - 2 * gap
- If wid < 480 Then wid = 480
- ValuesText.Width = wid
- hgt = ScaleHeight - ValuesText.Top - 2 * gap - CmdSetValues.Height
- If hgt < 480 Then hgt = 480
- ValuesText.Height = hgt
- CmdSetValues.Top = ValuesText.Top + hgt + gap
- CmdGetValues.Top = CmdSetValues.Top
- CmdClose.Top = CmdSetValues.Top
- End Sub
- ' ************************************************
- ' Trigger CmdClose.
- ' ************************************************
- Private Sub mnuFileClose_Click()
- CmdClose_Click
- End Sub
- Private Sub mnuHelpAbout_Click()
- AboutDialog.Show vbModal
- End Sub
- ' ************************************************
- ' Trigger CmdGetValues.
- ' ************************************************
- Private Sub mnuPropGet_Click()
- CmdGetValues_Click
- End Sub
- ' ************************************************
- ' Trigger CmdSetValues.
- ' ************************************************
- Private Sub mnuPropSet_Click()
- CmdSetValues_Click
- End Sub
-